package com.buaa.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;


@Data
//可以使用 @TableName 表名注解指定当前实体类对应的表名，比如下面 User 实体类对应表名为 sys_user
@TableName(value="police_user_extension")
public class UserExtension {


    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField(value = "user_id")
    private Integer userId;

    @TableField(value = "gender")
    private String gender;

    @TableField(value = "date_of_birth")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime dateOfBirth;

    @TableField(value = "join_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime joinDate;

    @TableField(value = "police_rank")
    private String policeRank; //职务

    @TableField(value = "police_org")
    private String policeOrg; //警察所在的部门（如：交警大队、指挥中心等）


    @TableField(value = "department")
    private String department; //警察所在的部门（如：交警大队、指挥中心等）

    @TableField(value = "duty_station")
    private String dutyStation; //警察的执勤地点（如：某路口、某交警队等）

    @TableField(value = "phone_number")
    private String phoneNumber; //电话号码

    @TableField(value = "email")
    private String email;

    @TableField(value = "home_address")
    private String homeAddress;


    //紧急联系人姓名
    @TableField(value = "emergency_contact_name")
    private String emergencyContactName;

    //紧急联系人电话
    @TableField(value = "emergency_contact_phone")
    private String emergencyContactPhone;

    //是否在职
    @TableField(value = "is_active")
    private Integer isActive;

//    所属警局ID，外键关联警局表
    @TableField(value = "station_id")
    private String stationId;

    @TableField(value = "police_province")
    private String policeProvince;

    @TableField(value = "police_city")
    private String policeCity;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT,value = "create_time")
    private LocalDateTime createTime;

//    @TableField(fill = FieldFill.UPDATE, value = "update_time")

    @TableField(value = "create_by")
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "revision_time")
    private LocalDateTime revisionTime;

    @TableField(value = "reviser")
    private String reviser;
}
